import { createRouter, createWebHistory } from 'vue-router'

const routes = [{
  path: '/flims',
  component: () =>
    import('../views/films.vue'),
  children: [{
    path: '/flims/nowplaying',
    name: 'nowplaying',
    component: () =>
      import('../views/films/nowPlaying.vue')

  },
  {
    path: 'comingsoon',
    component: () =>
      import('../views/films/comingSoon.vue')
  },
  {
    path: '/:pathMatch(.*)*',
    redirect: '/flims/nowplaying'
  }
  ]
},
{
  path: '/cinemas',
  component: () =>
    import('../views/Cinemas.vue')
},
{
  path: '/active',
  component: () =>
    import('../views/Active.vue')
},
{
  path: '/center',
  component: () =>
    import('../views/center.vue')
}, {
  path: '/:pathMatch(.*)*',
  redirect: '/flims/nowplaying'
}, {
  path: '/detial/:id',
  name: 'detial',
  component: () =>
    import('../views/detial.vue')
}, {
  path: '/city',
  name: 'city',
  component: () =>
    import('../views/city.vue')
}, {
  path: '/cinema/:id&location',
  name: 'cinema',
  component: () =>
    import('../views/cinema.vue')
}
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
